package com.heima.mongo.dao;

import com.heima.model.comment.pojos.Comment;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface CommentRepository extends MongoRepository<Comment, Long> {
    List<Comment> findAllByPublishTimeAfterAndArticleIdOrderByPublishTimeDesc(Date minDate, long articleId, Pageable pageable);

    Comment findCommentByParentIdAndId(String parentId, String id);
}
